/*
 * @copyright 2011 Gerald Jacobson
 * @license GNU General Public License
 * 
 * This file is part of GameTimer.
 *
 * GameTimer is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * GameTimer is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GameTimer. If not, see <http://www.gnu.org/licenses/>.
 */
package org.amphiption.gametimer.util;

/**
 * @author Amphiprion
 * 
 */
public class StringUtil {
	public static String durationToString(long counter) {
		String txt = "";
		int info = Math.round(counter / 1000.0f);
		int hour = info / 3600;
		if (hour > 0) {
			txt += hour + ":";
		}

		info = info - hour * 3600;
		int minute = info / 60;
		if (minute < 10) {
			txt += "0";
		}
		txt += minute + ":";
		info = info - minute * 60;
		int second = info;
		if (second < 10) {
			txt += "0";
		}
		txt += second;
		return txt;
	}
}
